import { FilterConst } from "../../../component/gconst/FilterConst";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { ResFileConst } from "../../resource/ResFileConst";
import { TransportInfo } from "../../model/TransportInfo";
import { TransportReward } from "../../rules/TransportReward";
import { GameConst } from "../../../component/gconst/GameConst";
import { Cache } from "../../cache/Cache";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../resource/ImagesConst";
type int = number;
//class TransportRewardPanel
    
    export  class TransportRewardPanel /* flash.display.Sprite */
    {
        constructor(arg1: int)
        {
            
            this._color = arg1;
            mouseChildren = false;
            mouseEnabled = false;
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            this._xsBmp = new Object /* flash.display.Bitmap */();
            addChild(this._xsBmp);
            this._jyBmp = new Object /* flash.display.Bitmap */();
            this._jyBmp.x = 2;
            this._jyBmp.y = 22;
            addChild(this._jyBmp);
            this._jyTxt = new Object /* flash.text.TextField */();
            this._jyTxt.mouseEnabled = false;
            this._jyTxt.width = 100;
            this._jyTxt.filters = [FilterConst.nameGlowFilter];
            this._jyTxt.x = this._jyBmp.x + 32;
            this._jyTxt.y = this._jyBmp.y;
            this._jyTxt.textColor = 16776960;
            addChild(this._jyTxt);
            this._tqBmp = new Object /* flash.display.Bitmap */();
            this._tqBmp.x = this._jyBmp.x;
            this._tqBmp.y = 38;
            addChild(this._tqBmp);
            this._tqTxt = new Object /* flash.text.TextField */();
            this._tqTxt.mouseEnabled = false;
            this._tqTxt.width = 100;
            this._tqTxt.filters = [FilterConst.nameGlowFilter];
            this._tqTxt.x = this._jyTxt.x;
            this._tqTxt.y = this._tqBmp.y;
            this._tqTxt.textColor = 16776960;
            addChild(this._tqTxt);
            LoaderHelp.addResCallBack(ResFileConst.daily, this.onDailyResLoadedHandler);
            LoaderHelp.addResCallBack(ResFileConst.transport, this.onTransportLoadedHandler);
            return;
        }

        public updateData(arg1: TransportInfo): void
        {
            var loc1=TransportReward.getTransportReward(this._color, GameConst.TransportRewardExpBase, Cache.instance.role.entityInfo.level);
            this._jyTxt.text = loc1.toString();
            this._tqTxt.text = arg1.rewardCoin.toString();
            return;
        }

        /* internal  */onTransportLoadedHandler(): void
        {
            this._xsBmp.bitmapData = GlobalClass.getBitmapData(ImagesConst.transportFont_XS);
            return;
        }

        /* internal  */onDailyResLoadedHandler(): void
        {
            this._jyBmp.bitmapData = GlobalClass.getBitmapData(ImagesConst.expText);
            this._tqBmp.bitmapData = GlobalClass.getBitmapData(ImagesConst.copperText);
            return;
        }

        /* internal */ /* var */_color: int;

        /* internal */ /* var */_xsBmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_jyBmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tqBmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_jyTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_tqTxt: Object /* flash.text.TextField */;
    }
